load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")

package(default_visibility = ["//rs:ic-os-pkg"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/sys",
    "@crate_index//:anyhow",
    "@crate_index//:clap",
]

DEV_DEPENDENCIES = [
    # Keep sorted.
]

MACRO_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "metrics_tool",
    srcs = glob(
        ["src/**/*.rs"],
        exclude = ["src/main.rs"],
    ),
    aliases = ALIASES,
    crate_name = "ic_metrics_tool",
    proc_macro_deps = MACRO_DEPENDENCIES,
    visibility = [
        "//rs:ic-os-pkg",
        "//rs:system-tests-pkg",
    ],
    deps = DEPENDENCIES,
)

rust_binary(
    name = "metrics_tool_bin",
    srcs = ["src/main.rs"],
    aliases = ALIASES,
    proc_macro_deps = MACRO_DEPENDENCIES,
    deps = DEPENDENCIES + [":metrics_tool"],
)

rust_test(
    name = "metrics_tool_test",
    crate = ":metrics_tool",
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
